package com.foreverwin.mes.production.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.foreverwin.mes.production.dto.ResourceInventoryDto;
import com.foreverwin.mes.production.model.ResourceInventory;
import com.baomidou.mybatisplus.service.IService;
import com.foreverwin.mes.core.base.FrontPage;
import com.foreverwin.mes.production.vo.ResourceInventoryVo;

import java.util.List;

/**
 * <p>
 * 设备库存 服务类
 * </p>
 *
 * @author Ervin Chen
 * @since 2020-02-04
 */
public interface ResourceInventoryService extends IService<ResourceInventory> {

    /**
     *  分页查询
     * @param frontPage
     * @return
     */
    Page<ResourceInventory> selectPage(FrontPage<ResourceInventory> frontPage, ResourceInventory resourceInventory);

    List<ResourceInventory> selectList(ResourceInventory resourceInventory);

    List<ResourceInventoryVo> selectResourceInventoryList(ResourceInventory resourceInventory);

    boolean insertOrUpdate(List<ResourceInventoryDto> resourceInventoryDtos);

    String getItemLoadMode( String itemBo );

    double getItemUpperDeviation( String itemBo );

    double getItemLowerDeviation( String itemBo );

    List<String> getResourceLoadItems( String resource );

    List<String> getResourceLoadItemGroups( String resource );

    boolean validateResourceLoadItem( String resource, String itemBo );

    boolean validateResourceLoadItemMatchBom( String sfc, String operation, String itemBo );

    boolean isProductionResource(String site, String resource);
}